package com.prelearning.at_springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.prelearning.at_springboot.entity.TestData;
import org.apache.ibatis.annotations.*;

import java.util.List;

//@Mapper
public interface TestDataMapper extends BaseMapper<TestData> {

    @Select("SELECT * from test")
    List<TestData> findAll();

    @Insert("INSERT INTO test(id, name) VALUES(#{id}, #{name})")
    int insert(TestData testData);

    //由mapper/TestData.xml文件设置动态sql
    int update(TestData testData);

    @Delete("delete from test where id= #{id}")
    Integer deleteById(@Param("id") Integer id);
}
